package cn.sm.dao;

import cn.sm.domain.User;
import cn.sm.mapper.UserMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: mayuanbao
 * @Date: 2018-12-01 14:30
 * @Description:
 */
@Repository(value = "userDao")
public class UserDaoJdbc extends BaseDao implements IUserDao {
    @Override
    public List<User> query(String id) {
//        List<User> userList = getSqlSession().selectList("user.getUser", id);
        return getSqlSession().getMapper(UserMapper.class).getUser(id);
    }

    @Override
    public int save(User user) {
        return getSqlSession().getMapper(UserMapper.class).insertUser(user);
    }
}
